<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }

    body{
      height: 2000px;
    }

    header{
      position: sticky;
      top: 0;
    }

    #a{
      margin-top: 200px;
      padding-top: 100px;
    }
  </style>
</head>
<body>
  <header>
    <nav>
      <li><a href="#a">test</a></li>
    </nav>
  </header>

  <main>
    <div class="test">
      <h1 id="a">test</h1>
      <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Suscipit fugit accusantium non, praesentium consectetur pariatur beatae, nulla exercitationem illum excepturi sequi aspernatur expedita eos corporis quibusdam, aliquam distinctio debitis delectus.</p>
    </div>
  </main>
</body>
</html>